home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Tool Chest / Interfaces / UniversalInterfaces 2.1B1 / AIncludes / AppleScript.a < prev    next >
Encoding:
Text File  |  1995-04-18  |  6.1 KB  |  214 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        AppleScript.a
  3. ;
  4. ;    Contains:    AppleScript Specific Interfaces.
  5. ;
  6. ;    Version:    Technology:    AppleScript 1.1
  7. ;                Package:    Universal Interfaces 2.1ß1 in “MPW Prerelease” on ETO #17
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__APPLESCRIPT__') = 'UNDEFINED' THEN
  21. __APPLESCRIPT__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
  25.     include 'Errors.a'
  26.     ENDIF
  27. ;        include 'ConditionalMacros.a'                                ;
  28.  
  29.     IF &TYPE('__APPLEEVENTS__') = 'UNDEFINED' THEN
  30.     include 'AppleEvents.a'
  31.     ENDIF
  32. ;        include 'Types.a'                                            ;
  33. ;        include 'Memory.a'                                            ;
  34. ;            include 'MixedMode.a'                                    ;
  35. ;        include 'OSUtils.a'                                        ;
  36. ;        include 'Events.a'                                            ;
  37. ;            include 'Quickdraw.a'                                    ;
  38. ;                include 'QuickdrawText.a'                            ;
  39. ;        include 'EPPC.a'                                            ;
  40. ;            include 'AppleTalk.a'                                    ;
  41. ;            include 'Files.a'                                        ;
  42. ;            include 'PPCToolbox.a'                                    ;
  43. ;            include 'Processes.a'                                    ;
  44. ;        include 'Notification.a'                                    ;
  45.  
  46.     IF &TYPE('__OSA__') = 'UNDEFINED' THEN
  47.     include 'OSA.a'
  48.     ENDIF
  49. ;        include 'AEObjects.a'                                        ;
  50. ;        include 'Components.a'                                        ;
  51.  
  52.     IF &TYPE('__TEXTEDIT__') = 'UNDEFINED' THEN
  53.     include 'TextEdit.a'
  54.     ENDIF
  55.  
  56. typeAppleScript                    EQU        'ascr'
  57. kAppleScriptSubtype                EQU        typeAppleScript
  58. typeASStorage                    EQU        typeAppleScript
  59.  
  60. ;*************************************************************************
  61. ;    Component Selectors
  62. ;*************************************************************************
  63. kASSelectInit                    EQU        $1001
  64. kASSelectSetSourceStyles        EQU        $1002
  65. kASSelectGetSourceStyles        EQU        $1003
  66. kASSelectGetSourceStyleNames    EQU        $1004
  67.  
  68. ;*************************************************************************
  69. ;    OSAGetScriptInfo Selectors
  70. ;*************************************************************************
  71. kASHasOpenHandler                EQU        'hsod'
  72.  
  73. ;
  74. ;        This selector is used to query a context as to whether it contains
  75. ;        a handler for the kAEOpenDocuments event. This allows "applets" to be 
  76. ;        distinguished from "droplets."  OSAGetScriptInfo returns false if
  77. ;        there is no kAEOpenDocuments handler, and returns the error value 
  78. ;        errOSAInvalidAccess if the input is not a context.
  79. ;    
  80. ;*************************************************************************
  81. ;    Initialization
  82. ;*************************************************************************
  83. ;
  84. ; pascal OSAError ASInit(ComponentInstance scriptingComponent, long modeFlags, long minStackSize, long preferredStackSize, long maxStackSize, long minHeapSize, long preferredHeapSize, long maxHeapSize)
  85. ;
  86.     IF ¬ GENERATINGCFM THEN
  87.         Macro
  88.         _ASInit
  89.             dc.w     $2F3C
  90.             dc.w     $001C
  91.             dc.w     $1001
  92.             moveq    #0,d0
  93.             dc.w     $A82A
  94.         EndM
  95.     ELSE
  96.         IMPORT_CFM_FUNCTION    ASInit
  97.     ENDIF
  98.  
  99. ;
  100. ;        ComponentCallNow(kASSelectInit, 28);
  101. ;        This call can be used to explicitly initialize AppleScript.  If it is
  102. ;        not called, the a scripting size resource is looked for and used. If
  103. ;        there is no scripting size resource, then the constants listed below
  104. ;        are used.  If at any stage (the init call, the size resource, the 
  105. ;        defaults) any of these parameters are zero, then parameters from the
  106. ;        next stage are used.  ModeFlags are not currently used.
  107. ;        Errors:
  108. ;        errOSASystemError        initialization failed
  109. ;    
  110. ;
  111. ;    These values will be used if ASInit is not called explicitly, or if any
  112. ;    of ASInit's parameters are zero:
  113. ;
  114. kASDefaultMinStackSize            EQU        4 * 1024
  115. kASDefaultPreferredStackSize    EQU        16 * 1024
  116. kASDefaultMaxStackSize            EQU        16 * 1024
  117. kASDefaultMinHeapSize            EQU        4 * 1024
  118. kASDefaultPreferredHeapSize        EQU        16 * 1024
  119. kASDefaultMaxHeapSize            EQU        32 * 1024 * 1024
  120.  
  121. ;*************************************************************************
  122. ;    Source Styles
  123. ;*************************************************************************
  124. ;
  125. ; pascal OSAError ASSetSourceStyles(ComponentInstance scriptingComponent, STHandle sourceStyles)
  126. ;
  127.     IF ¬ GENERATINGCFM THEN
  128.         Macro
  129.         _ASSetSourceStyles
  130.             dc.w     $2F3C
  131.             dc.w     $0004
  132.             dc.w     $1002
  133.             moveq    #0,d0
  134.             dc.w     $A82A
  135.         EndM
  136.     ELSE
  137.         IMPORT_CFM_FUNCTION    ASSetSourceStyles
  138.     ENDIF
  139.  
  140. ;
  141. ;        ComponentCallNow(kASSelectSetSourceStyles, 4);
  142. ;        Errors:
  143. ;        errOSASystemError        operation failed
  144. ;    
  145. ;
  146. ; pascal OSAError ASGetSourceStyles(ComponentInstance scriptingComponent, STHandle *resultingSourceStyles)
  147. ;
  148.     IF ¬ GENERATINGCFM THEN
  149.         Macro
  150.         _ASGetSourceStyles
  151.             dc.w     $2F3C
  152.             dc.w     $0004
  153.             dc.w     $1003
  154.             moveq    #0,d0
  155.             dc.w     $A82A
  156.         EndM
  157.     ELSE
  158.         IMPORT_CFM_FUNCTION    ASGetSourceStyles
  159.     ENDIF
  160.  
  161. ;
  162. ;        ComponentCallNow(kASSelectGetSourceStyles, 4);
  163. ;        Errors:
  164. ;        errOSASystemError        operation failed
  165. ;    
  166. ;
  167. ; pascal OSAError ASGetSourceStyleNames(ComponentInstance scriptingComponent, long modeFlags, AEDescList *resultingSourceStyleNamesList)
  168. ;
  169.     IF ¬ GENERATINGCFM THEN
  170.         Macro
  171.         _ASGetSourceStyleNames
  172.             dc.w     $2F3C
  173.             dc.w     $0008
  174.             dc.w     $1004
  175.             moveq    #0,d0
  176.             dc.w     $A82A
  177.         EndM
  178.     ELSE
  179.         IMPORT_CFM_FUNCTION    ASGetSourceStyleNames
  180.     ENDIF
  181.  
  182. ;
  183. ;        ComponentCallNow(kASSelectGetSourceStyleNames, 8);
  184. ;        This call returns an AEList of styled text descriptors the names of the
  185. ;        source styles in the current dialect.  The order of the names corresponds
  186. ;        to the order of the source style constants, below.  The style of each
  187. ;        name is the same as the styles returned by ASGetSourceStyles.
  188. ;        
  189. ;        Errors:
  190. ;        errOSASystemError        operation failed
  191. ;    
  192. ;
  193. ;    Elements of STHandle correspond to following categories of tokens, and
  194. ;    accessed through following index constants:
  195. ;
  196. kASSourceStyleUncompiledText    EQU        0
  197. kASSourceStyleNormalText        EQU        1
  198. kASSourceStyleLanguageKeyword    EQU        2
  199. kASSourceStyleApplicationKeyword EQU        3
  200. kASSourceStyleComment            EQU        4
  201. kASSourceStyleLiteral            EQU        5
  202. kASSourceStyleUserSymbol        EQU        6
  203. kASSourceStyleObjectSpecifier    EQU        7
  204. kASNumberOfSourceStyles            EQU        8
  205.  
  206. ; Gestalt selectors for AppleScript 
  207. gestaltAppleScriptAttr            EQU        'ascr'
  208. gestaltAppleScriptVersion        EQU        'ascv'
  209.  
  210. gestaltAppleScriptPresent        EQU        0
  211. gestaltAppleScriptPowerPCSupport EQU        1
  212.  
  213.     ENDIF ; __APPLESCRIPT__
  214.